//
//  HACSectionThree.m
//  HACDispatcher
//
//  Created by Chengjie on 2019/5/15.
//  Copyright © 2019 Happy. All rights reserved.
//

#import "HACSectionThree.h"
#import "HACDemoTwoHeader.h"
#import "HACLayoutCell.h"

@implementation HACSectionThree

- (void)registTableReusableView {
    Class headerCls = [HACDemoTwoHeader class];
    [self.tableView registerClass:headerCls forHeaderFooterViewReuseIdentifier:NSStringFromClass(headerCls)];
    Class cls = [HACLayoutCell class];
    [self.tableView registerClass:cls forCellReuseIdentifier:NSStringFromClass(cls)];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"%s--/n%@", __func__, self.viewController);
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 54;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    Class headerCls = [HACDemoTwoHeader class];
    NSString *idfs = NSStringFromClass(headerCls);
    HACDemoTwoHeader *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:idfs];
    if (!header) {
        header = [[HACDemoTwoHeader alloc] initWithReuseIdentifier:idfs];
    }
    header.textLabel.text = @"第三组模块";
    return header;
}

- (void)dealloc {
    NSLog(@"%s", __func__);
}

@end
